<?php
class docController extends AController {
	public function selectDocsAction() {
		$depno = $this->request->getGetParameter('depid');
		$type = $this->request->getGetParameter('type');
		switch ($type) {
			case 'ZY': $dep = "ZY_DEP_NO"; break;
			default: $dep = 'MZ_DEP_NO'; break;
		}
		$rs = JYDB::findAll('DOCTOR', "{$dep}='{$depno}' AND UNIT_ID=".CSM_UNIT_ID, 'DOC_NO, DOCTOR_ID, DOCTOR_NAME');
		$this->docs = $rs ? $rs : array(array('DOC_NO'=>'', 'DOCTOR_NAME'=>'没有可选医生'));
		return $this->render();
	}
}